<template>
  <a-modal
    title="查看字典详情"
    :width="800"
    :visible="visible"
    :footer="null"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
          <p>{{ details.login }}</p>
        </a-form-item>

        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="真实姓名">
          <p>{{ details.userName }}</p>
        </a-form-item>

        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="角色名称" hasFeedback>
          <p>{{ details.tRole.name }}</p>
        </a-form-item>
        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="状态" hasFeedback>
          <p v-if="details.activated === '1'">正常</p>
          <p v-if="details.activated === '0'">禁用</p>
        </a-form-item>
        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="邮箱" hasFeedback>
          <p>{{ details.email }}</p>
        </a-form-item>
        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话" hasFeedback>
          <p>{{ details.phone }}</p>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
export default {
  name: 'CheckUsersManageModal',
  data () {
    return {
      visible: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      details: {
        tRole: {
          name: ''
        }
      },
      form: this.$form.createForm(this)
    }
  },

  methods: {
    check (record) {
      this.details = Object.assign({}, record)
      console.log('接收列表行参数-----', this.details)
      this.visible = true
    },

    handleCancel () {
      this.visible = false
    }
  }
}
</script>
<style lang="less" scoped>
.ant-row {
  margin-bottom: 0;
}
</style>
